//
//  DataManager.m
//  Community
//
//  Created by YaSha_Tom on 2018/12/21.
//  Copyright © 2018年 YaSha-Tom. All rights reserved.
//

#import "DataManager.h"
#import <MJExtension.h>
#import "FoundModel.h"

@implementation DataManager

static DataManager *_datamanager = nil;
+ (DataManager *)sharedDataManager {
    if (!_datamanager) {
        _datamanager = [[DataManager alloc] init];
    }
    return _datamanager;
}
+ (NSArray *)getAddressData:(id)responseObject {
    NSArray *orderArray = responseObject[@"destinations"];
    NSMutableArray *mutableArray = [NSMutableArray array];
    for (NSDictionary *dic in orderArray) {
        //字典转model的第三方MJExtension
        FoundModel *model = [FoundModel mj_objectWithKeyValues:dic];
        [mutableArray addObject:model];
    }
    return [mutableArray copy];
}
+ (NSArray *)getStrategyData:(id)responseObject {
    NSArray *orderArray = responseObject[@"data"];
    NSMutableArray *mutableArray = [NSMutableArray array];
    for (NSDictionary *dic in orderArray) {
        //字典转model的第三方MJExtension
        FoundModel *model = [FoundModel mj_objectWithKeyValues:dic];
        [mutableArray addObject:model];
    }
    return [mutableArray copy];
}
+ (NSArray *)getStrategyInfoData:(id)responseObject {
    NSArray *orderArray = responseObject[@"data"][@"inspirations"];
    NSMutableArray *mutableArray = [NSMutableArray array];
    for (NSDictionary *dic in orderArray) {
        //字典转model的第三方MJExtension
        FoundModel *model = [FoundModel mj_objectWithKeyValues:dic];
        [mutableArray addObject:model];
    }
    return [mutableArray copy];
}
@end
